class UserAgentHelper {
	constructor(arg) {
		// #ifdef H5
		this.ua = navigator.userAgent.toLowerCase();
		// #endif 
		// this.ua = `Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.54(0x18003634) NetType/WIFI Language/zh_CN`
	}
	isWechet() {
		let regex = /MicroMessenger/i
		return regex.test(this.ua)
	}
	isQQ() {
		let regex = /QQ/i
		return regex.test(this.ua)
	}
	isAlipay() {
		let regex = /AlipayClient/i
		return regex.test(this.ua)
	}
	isIos() {
		let regex = /iPhone/i
		// console.log(regex.test(this.ua))
		return regex.test(this.ua)
	}
	isAndroid() {
		let regex = /Android/i
		return regex.test(this.ua)
	}
	isAppWebKit() {
		let list = [this.isWechet(), this.isQQ(), this.isAlipay()]
		// console.log(list)
		return list.findIndex(t => t) > -1
	}

}



export default new UserAgentHelper()